package com.fwj.authorization.staff.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fwj.authorization.staff.entity.SysRole;
import com.fwj.authorization.staff.mapper.SysRoleMapper;
import com.fwj.authorization.staff.service.SysRoleService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 角色
 *
 * @author 樊温军
 * @date 2025/3/18 上午10:32
 */
@Service
public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements SysRoleService {

    @Override
    public IPage<SysRole> getPage(Page<SysRole> page, SysRole sysRole) {
        return baseMapper.getPage(page, sysRole);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public Boolean saveRole(List<SysRole> sysRoles) {
        return this.saveOrUpdateBatch(sysRoles);
    }
}
